Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed batch query body to from [...] to { queries: [...] } #4975

Merged
merged 4 commits into from
Aug 14, 2023

Conversation

jawj
Copy link
Contributor

@jawj jawj commented Aug 11, 2023

Problem

It's nice if single query : single response :: batch query : batch response.

But at present, in the single case we send { query: '', params: [] } and get back a single { rows: [], ... } object, while in the batch case we send an array of { query: '', params: [] } objects and get back not an array of { rows: [], ... } objects but a { results: [ { rows: [] , ... }, { rows: [] , ... }, ... ] } object instead.

Summary of changes

With this change, the batch query body becomes { queries: [{ query: '', params: [] }, ... ] }, which restores a consistent relationship between the request and response bodies.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

@jawj jawj requested review from kelvich and skyzh August 11, 2023 13:48
@jawj jawj requested a review from a team as a code owner August 11, 2023 13:48
@jawj jawj requested review from NanoBjorn and removed request for a team August 11, 2023 13:48
@github-actions
Copy link

github-actions bot commented Aug 11, 2023

1584 tests run: 1506 passed, 0 failed, 78 skipped (full report)


The comment gets automatically updated with the latest test results
590ec36 at 2023-08-11T15:46:37.636Z :recycle:

@kelvich kelvich requested a review from conradludgate August 14, 2023 15:06
@jawj jawj merged commit 1ca08cc into main Aug 14, 2023
@jawj jawj deleted the jawj/http-batch-query-tweak branch August 14, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants